cmake_minimum_required(VERSION 3.19)
project(XLayout VERSION 1.0)

# 全局关闭（不推荐）
if(MSVC)
    add_compile_options(/W0)          # MSVC: 禁用所有警告
else()
    add_compile_options(-w)           # GCC/Clang: -w 禁用所有警告
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# 设置输出文件路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})

# src 编译
if(BUILD_SRC)
    message("***********BUILD_SRC*************")
    add_subdirectory(src)
endif()

# external 编译
if(BUILD_EXTERNAL)
    add_subdirectory(external)
endif()
